package com.yutian.endecryption.mock.mapper;

import com.yutian.endecryption.mock.pojo.Examinee;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * 考生信息Mapper
 *
 * @author zhang peng yang ming
 * @create 2017-08-01 9:57
 */
public interface ExamineeMapper {
    /**
     * 查询身份证号码为 sfzmhm 的考生
     * @param sfzmhm
     * @return
     */
    @Select("SELECT * FROM vt_examinee_info WHERE sfzmhm=#{sfzmhm}")
    Examinee retrieveExaminee (String sfzmhm);

    @Insert("INSERT INTO vt_examinee_info(lsh, kskm, zkzmbh, sfzmhm, xm, yyrq, ykrq, kscc, glbm, ksrq, kscs, ksy1, zt, yycs, bcyykscs, kscx, ksdd, ckyy) VALUES(#{lsh}, #{kskm}, #{zkzmbh}, #{sfzmhm}, #{xm}, #{yyrq}, #{ykrq}, #{kscc}, #{glbm}, #{ksrq}, #{kscs}, #{ksy1}, #{zt}, #{yycs}, #{bcyykscs}, #{kscx}, #{ksdd}, #{ckyy})")
    int createExaminee (Examinee examinee);

    @Update("UPDATE vt_examinee_info SET yyrq=#{yyrq}, ykrq=#{ykrq}, kscc=#{kscc}, ksrq=#{ksrq}, kscs=#{kscs}, ksy1=#{ksy1}, zt=#{zt}, yycs=#{yycs}, bcyykscs=#{bcyykscs}, kscx=#{kscx}, ckyy=#{ckyy} WHERE id=#{id}")
    int updateExaminee (Examinee examinee);
}
